import request from '@/utils/request'
// 查询用户列表
export function listUser(query) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: {
      nickName: query,
      pageNum: 1,
      pageSize: 10
    }
  })
}

// 查询车辆列表
export function listVehicles(query) {
  return request({
    url: '/vehicles/vehicles/list', // 假设接口是这个，实际改成你后台接口路径
        method: 'get',
        params: {
          carNumber: query,
          pageNum: 1,
          pageSize: 10
        }
  })
}

// 查询维护记录列表
export function listRecords(query) {
  return request({
    url: '/vehicles/records/list',
    method: 'get',
    params: query
  })
}

// 查询维护记录详细
export function getRecords(id) {
  return request({
    url: '/vehicles/records/' + id,
    method: 'get'
  })
}

// 新增维护记录
export function addRecords(data) {
  return request({
    url: '/vehicles/records',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 修改维护记录
export function updateRecords(data) {
  return request({
    url: '/vehicles/records',
    method: 'put',
    data: data
  })
}

// 删除维护记录
export function delRecords(id) {
  return request({
    url: '/vehicles/records/' + id,
    method: 'delete'
  })
}
